<template>

  <div >
   <!-- <x-header >登陆</x-header > -->
   <div class="text-font logotit">登录账户</div>

    <div class="logo-input">
      <x-input title=""  placeholder="输入邮箱或用户名" :min="2" :max="25" v-model="username" name="username">
        <i slot="label"  class="icon iconfont">&#xe616;</i>
      </x-input>
    </div>

    <div class="logo-input">
      <x-input title=""  placeholder="请输入密码" :show-clear="false"  :type="yj?'text':'password'" v-model="password" name="password">
        <i slot="label"  class="icons iconfont">&#xe68f;</i>
        <i slot="right"  class="icons iconfont"  @click="yj=!yj" v-html="yj?'&#xe68b;':'&#xe600;'"></i>
      </x-input>
    </div>
    <!-- <check-icon :value.sync="demo1">({{ demo1 }})</check-icon> -->
    <router-link to="logo/resgi">
      <div class="wjpassword">忘记密码？</div>
    </router-link>
    <div class="submitbuttom" >
    <!-- show-loading -->
        <x-button type="primary"  :show-loading=loadin @click.native="submit" >登录</x-button>
    </div>
    <div class="fixedfooter">
    没有账号？ <router-link to="logo/registered">
        <span class="cj">创建一个!</span>
    </router-link>
    </div>
  </div>
</template>

<script>
import { XInput ,XButton,CheckIcon} from 'vux'
import {config,lzd_localStorage,lzd_ajax} from '../resources/js/commit.js'
export default {
  components: {
    XInput,
    XButton,
    CheckIcon
  },
    data () {
    return {
      // demo1: false,
      loadin:false,
      yj:false,
      b:{},
      username:"admin",
      password:"111111"

      // submit001: 'click me',
      // disable001: false
    }
  },
  methods:{
    submit(){
      var self=this;
      this.loadin=true;
      lzd_ajax.ajaxpost(this,config.logo,{
            usertype:1,
            username:this.username,
            password:this.password
          },function(data){
            lzd_localStorage.localStorage(2,data);
            self.loadin=false;
            self.$router.push('/home');
          },function(){
            alert("请检查网络")
      })
    }
  },
  mounted () {
    this.$nextTick(function() {
     setTimeout(()=>{this.$store.state.isload=false},100)
      // alert(this.$store.state.username)
        // DingConf("f")
      // var cs='"'+localStorage.userData+'"';
      // alert(JSON.stringify(obje))
      // alert(typeof cs)
 // alert(JSON.parse(cs).name)
     // alert(typeof lzd_localStorage(1))
    })
  }
}
</script>
<style lang="scss">

</style>
